home *** CD-ROM | disk | FTP | other *** search
/ Aminet 5 / Aminet 5 - March 1995.iso / Aminet / text / misc / pcal_4_5.lha / pcal / pcalglob.h < prev    next >
C/C++ Source or Header  |  1994-10-16  |  5KB  |  214 lines

  1. /*
  2.  * pcalglob.h - definitions and declarations of globals used throughout Pcal
  3.  *
  4.  * Revision history:
  5.  *
  6.  *    4.5    AWR    02/05/93    Added support for -# flag (multiple
  7.  *                    copies of output page)
  8.  *
  9.  *        AWR    11/16/92    Use common "protos.h" file (q.v.)
  10.  *
  11.  *    4.4    AWR    01/20/92    Added support for -z flag and revised
  12.  *                    -[bgGO]
  13.  *
  14.  *    4.3    AWR    12/05/91    Add global "progpath" (used when
  15.  *                    searching for moon file)
  16.  *
  17.  *        AWR    12/03/91    Added support for -s flag
  18.  *
  19.  *    4.2    AWR    10/08/91    Added support for -[kK] flags
  20.  *
  21.  *        AWR    10/02/91    Added support for -c, -N, -S flags
  22.  *
  23.  *    4.1    AWR    07/16/91    Added support for -G flag
  24.  *
  25.  *    4.0    AWR    01/28/91    Added support for -b and -w flags
  26.  *
  27.  *        AWR    01/15/91    Extracted from pcal.c
  28.  *
  29.  */
  30.  
  31. #include "protos.h"
  32.  
  33. /*
  34.  * Definitions and/or declarations of globals
  35.  */
  36.  
  37. #ifdef MAIN_MODULE
  38.  
  39. /*
  40.  * Misc. globals
  41.  */
  42.  
  43. year_info *head = NULL;        /* head of internal data structure */
  44. int curr_year;            /* current default year for date file entries */
  45. char *words[MAXWORD];        /* maximum number of words per date file line */
  46. char lbuf[LINSIZ];        /* date file source line buffer */
  47. char progname[STRSIZ];        /* program name (for error messages) */
  48. char progpath[STRSIZ];        /* directory where executable lives */
  49. char version[20];        /* program version (for info messages) */
  50.  
  51. /* lengths and offsets of months in common year */
  52. char month_len[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
  53. short month_off[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
  54.  
  55. /* dispatch table for wildcard matching routines - cf. pcaldefs.h */
  56. #ifdef PROTOS
  57. int (*pdatefcn[])(int, int, int) = {
  58. #else
  59. int (*pdatefcn[])() = {
  60. #endif
  61.     is_anyday, is_weekday, is_workday, is_holiday, not_weekday, not_workday,
  62.     not_holiday, is_newmoon, is_firstq, is_fullmoon, is_lastq
  63.     };
  64.  
  65. /*
  66.  * Default values for command-line options:
  67.  */
  68.  
  69. char default_color[] = DAY_COLOR;     /* -b, -g, -G, -O */
  70. char day_color[7];
  71. int holiday_color;
  72. int weekday_color = WEEKDAY_COLOR;
  73.  
  74. int datefile_type = SYS_DATEFILE;    /* -e, -f */
  75. char datefile[STRSIZ] = "";
  76.  
  77. int rotate = ROTATE;            /* -l, -p */
  78.  
  79. int draw_moons = DRAW_MOONS;        /* -m, -M */
  80.  
  81. char datefont[STRSIZ] = DATEFONT;    /* -d, -t, -n */
  82. char titlefont[STRSIZ] = TITLEFONT;
  83. char notesfont[STRSIZ] = NOTESFONT;
  84.  
  85. int mapfonts = MAPFONTS;        /* -r */
  86.  
  87. char shading[STRSIZ] = SHADING;        /* -s */
  88.  
  89. char lfoot[STRSIZ] = LFOOT;             /* -L, -C, -R */
  90. char cfoot[STRSIZ] = CFOOT;
  91. char rfoot[STRSIZ] = RFOOT;
  92.  
  93. char notes_hdr[STRSIZ];            /* -N (initialized in main()) */
  94.  
  95. int first_day_of_week = FIRST_DAY;    /* -F */
  96.  
  97. int date_style = DATE_STYLE;        /* -A, -E */
  98.  
  99. char outfile[STRSIZ] = OUTFILE;        /* -o */
  100.  
  101. char xsval[VALSIZ] = XSVAL;        /* -x, -y, -X, -Y */
  102. char ysval[VALSIZ] = YSVAL;
  103. char xtval[VALSIZ] = XTVAL;
  104. char ytval[VALSIZ] = YTVAL;
  105.  
  106. int julian_dates = JULIAN_DATES;    /* -j */
  107.  
  108. int do_whole_year = DO_WHOLE_YEAR;    /* -w */
  109.  
  110. int calendar_out = CALENDAR_OUT;    /* -c */
  111.  
  112. int blank_boxes = BLANK_BOXES;        /* -B */
  113.  
  114. char ncopy[VALSIZ] = NCOPY;        /* -# */
  115.  
  116. int small_cal_pos = SMALL_CAL_POS;    /* -k, -K, -S */
  117. int prev_cal_box[4] = PREV_CAL_BOX;
  118. int next_cal_box[4] = NEXT_CAL_BOX;
  119.  
  120. char time_zone[STRSIZ] = TIMEZONE;    /* -z */
  121. double utc_offset;
  122. int tz_flag = FALSE;
  123.  
  124. int debug_flags = 0;            /* -Z */
  125.  
  126. #else
  127.  
  128. /*
  129.  * Misc. globals
  130.  */
  131.  
  132. extern year_info *head;        /* head of internal data structure */
  133. extern int curr_year;        /* current default year for date file entries */
  134. extern char *words[];        /* maximum number of words per date file line */
  135. extern char lbuf[];        /* date file source line buffer */
  136. extern char progname[];        /* program name (for error messages) */
  137. extern char progpath[];        /* directory where executable lives */
  138. extern char version[];        /* program version (for info messages) */
  139.  
  140. /* lengths and offsets of months in common year */
  141. extern char month_len[];
  142. extern short month_off[];
  143.  
  144. /* dispatch functions and table for wildcard processing */
  145. #ifdef PROTOS
  146. extern int (*pdatefcn[])(int, int, int);
  147. #else
  148. extern int (*pdatefcn[])(); 
  149. #endif
  150.  
  151. /*
  152.  * Default values for command-line options:
  153.  */
  154.  
  155. extern char default_color[];         /* -b, -g, -G, -O */
  156. extern char day_color[];
  157. extern int holiday_color;
  158. extern int weekday_color;
  159.  
  160. extern int datefile_type;        /* -e, -f */
  161. extern char datefile[];
  162.  
  163. extern int rotate;            /* -l, -p */
  164.  
  165. extern int draw_moons;            /* -m, -M */
  166.  
  167. extern char datefont[];            /* -d, -t, -n */
  168. extern char titlefont[];
  169. extern char notesfont[];
  170.  
  171. extern int mapfonts;            /* -r */
  172.  
  173. extern char shading[];            /* -s */
  174.  
  175. extern char lfoot[];            /* -L, -C, -R */
  176. extern char cfoot[];
  177. extern char rfoot[];
  178.  
  179. extern char notes_hdr[];        /* -N */
  180.  
  181. extern int first_day_of_week;        /* -F */
  182.  
  183. extern int date_style;            /* -A, -E */
  184.  
  185. extern char outfile[];            /* -o */
  186.  
  187. extern char xsval[];            /* -x, -y, -X, -Y */
  188. extern char ysval[];
  189. extern char xtval[];
  190. extern char ytval[];
  191.  
  192. extern int julian_dates;        /* -j */
  193.  
  194. extern int do_whole_year;        /* -w */
  195.  
  196. extern int calendar_out;        /* -c */
  197.  
  198. extern int blank_boxes;            /* -B */
  199.  
  200. extern char ncopy[];            /* -# */
  201.  
  202. extern int small_cal_pos;        /* -k, -K, -S */
  203. extern int prev_cal_box[];
  204. extern int next_cal_box[];
  205.  
  206. extern char time_zone[];        /* -z */
  207. extern double utc_offset;
  208. extern int tz_flag;
  209.  
  210. extern int debug_flags;            /* -Z */
  211.  
  212. #endif
  213.  
  214.